/**
 * 玩家建议列表
 */

var advice = new Object({
    table:null,
    init:function(){
        if(null != this.table)
            return;
        this.queryInfo();
        this.bindEvent();
    },
    queryInfo:function(){
        this.table = $('#tb_advice').bootstrapTable({
            url: contextPath + '/advice/listData.json',
            responseHandler: function (res) {
                return res.data;
            },
            queryParams: function (params) {
                return params;
            },
            pagination: true,
            pageList: '[10,20,50,100]',
            //showColumns: true,
            showRefresh: true,
            showToggle: true,
            //showPaginationSwitch:true,
            sidePagination: 'server',
            //striped:true,
            sortable: false,
            height: 700,
            search: true,
            searchAlign: 'left',
            idField: 'id',
            uniqueId: 'id',
            //singleSelect: true,
            clickToSelect: true,
            columns: [{
                field: 'player.nickname',
                title: '玩家昵称',
                width: 100
            }, {
                field: 'contact',
                title: '联系方式',
                width: 100
            }, {
                field: 'advice',
                title: '建议内容',
                width: 500
            }, {
                field: 'createTime',
                title: '创建时间',
                width: 150,
                formatter:function(value,row,index){
                    if(value != null) {
                        return (new Date(value)).Format("yyyy-MM-dd hh:mm:ss");
                    }
                    return "";
                }
            }]
        });
        $('.search input').attr("placeholder", "玩家昵称|联系方式|内容");
    },
    bindEvent: function () {
    }
});